﻿using OOPA_opdracht.Model.FileFactory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OOPA_opdracht.Model
{
    public class Circuit
    {
        //private Node inputNodeA, inputNodeB, inputCin, inputNodeCout;

        public Circuit()
        {
        }

        public void read()
        {
            //read the file
            InputReader inputReader = new InputReader();
            setTheirOutputs(inputReader);
        }

        public void read(string filename)
        {
            //read the file
            InputReader inputReader = new InputReader(filename);
            setTheirOutputs(inputReader);
        }

        private void setTheirOutputs(InputReader inputReader)
        {
            List<MainNode> inputs = inputReader.read();

            foreach (MainNode n in inputs)
                n.setInput(n.getOutput());
        }
    }
}
